#include <iostream>
#include "BuildingRegister.h"
using namespace std;

void main()
{
	setlocale(LC_ALL, "swedish");
	cout << "		===BETYG 3===" << endl << endl;
	cout << "	==Uppgift 3.1==" << endl;
	Room room1;
	Room room2(1,200, "samlingslokal");

	cout << "Getter/Setters" << endl;
	cout << room1.GetArea() << endl;
	cout << room2.GetType() << endl;
	room1.SetArea(40);
	cout << room1.GetArea() << endl;
	room2.SetType("Bedroom");
	cout << room2.GetType() << endl << endl;


	cout << "	==Uppgift 3.2==" << endl;
	Room room3;
	//room3.Read();
	//room3.Write();
	cout << endl << endl;


	cout << "	==Uppgift 3.3==" << endl;
	cout << room2 << endl;
	Room room4;
	istringstream iss("(2,400,Livingroom)");
	iss >> room4;
	cout << room4 << endl << endl;


	cout << "	==Uppgift 3.4==" << endl;
	Building b1;
	b1.Add(room1);
	b1.Add(room2);
	b1.Add(room3);
	b1.Add(room4);
	b1.Delete(1);
	b1.Search(1);
	b1.Search(2);
	cout << b1.List();
	cout << endl << endl;

	cout << "	==Uppgfit 3.5==" << endl;
	b1.WriteToFile("B2.txt");
	cout << endl << endl;

	cout << "	==Uppgift 3.6==" << endl;
	b1.ReadFromFile("B2.txt");
	b1.WriteToFile("B2.txt");
	cout << endl << endl;

	cout << "	==Uppgift 3.7==" << endl;
	b1.Area();
	cout << endl << endl;

	cout << "			===Betyg 4===" << endl;
	BuildingRegister br;
	while (1)
	{
		cout << br;
		cin >> br;
	}


	system("pause");
}